package com.whminwei.edu.api.file.client;

import com.whminwei.common.feign.config.MultipartSupportConfig;
import com.whminwei.common.http.rspn.FullHttpResponse;
import com.whminwei.edu.api.file.po.FileRspn;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.lang.NonNull;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author wangy
 * @since 2023-11-13
 */
@FeignClient(name = "xzzg-file-system", contextId = "for-file", configuration = {MultipartSupportConfig.class, FullHttpResponse.class})
public interface FileClient {

    @PostMapping(value = "/file/upload", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    FullHttpResponse<FileRspn> upload(@RequestPart("file") MultipartFile file, @RequestParam("serviceNo") @NonNull String serviceNo);
}
